/*
 * Copyright (c) 2025 Huawei Device Co., Ltd. All rights reserved
 * Use of this source code is governed by a MIT license that can be
 * found in the LICENSE file.
 */


import React, { useState } from "react";
import { View, Text, Button } from "react-native";
import { getStatusBarHeight } from 'react-native-status-bar-height';

const App = (props) => {

    let [statusBarHeight,setData] = useState({});
    
    const getstatusbarHeight = () => {
    statusBarHeight = getStatusBarHeight(false);
    setData(statusBarHeight) 
    console.debug(statusBarHeight);
  };

  return (
    <View style={{ margin: 50, flexDirection: "column", justifyContent: "space-between" }}>
      <View>
        <Button
              title="getStatusBarHeight"
              onPress={() => getstatusbarHeight()}
            />
            <Text>{"statusBarHeight: "+JSON.stringify(statusBarHeight)}</Text>
      </View>
    </View>
  );
};

export default class GetStatusBarHeightPage extends React.Component {
  render() {
    return (
      <App {...this.props} />
    );
  }
}